package com.dt76.smallloanfrontendservice.controller.xiaohao;

import com.dt76.smallloanfrontendservice.pojo.xiaohao.BorrowOrder;
import com.dt76.smallloanfrontendservice.service.xiaohao.BorrowOrderService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class BorrowOrderController {

    @Resource
    private BorrowOrderService borrowOrderService;

    @RequestMapping("/xiaohao/BorrowOrder/addBorrowOrder")
    @ResponseBody
    public int addBorrowOrder(@RequestBody BorrowOrder borrowOrder) {
        return borrowOrderService.addBorrowOrder(borrowOrder);
    }

    @RequestMapping("/xiaohao/BorrowOrder/qryAllBorrowOrderByUId")
    @ResponseBody
    public List<BorrowOrder> qryAllBorrowOrderByUId(int userId) {
        return borrowOrderService.qryAllBorrowOrderByUId(userId);
    }

    @RequestMapping("/xiaohao/BorrowOrder/qryBorrowOrderBybOID")
    @ResponseBody
    public BorrowOrder qryBorrowOrderBybOID(int boId) {
        return borrowOrderService.qryBorrowOrderBybOID(boId);
    }
}
